package sk.tuke.client.areas;

import com.google.gwt.core.client.GWT;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.widgets.Img;
import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.layout.HLayout;

public class HeadArea extends HLayout {

	private static final int HEIGHT = 80;

	public HeadArea() {
		super();

		GWT.log("init Head()...", null);

		// initialise the Masthead layout container
		this.setStyleName("head");
		this.setHeight(HEIGHT);

		// initialise the Logo image
		Img logo = new Img("logo.jpg", 400, 80);
		logo.setStyleName("head-Logo");

		// initialise the Name label

		// initialise the West layout container
		HLayout westLayout = new HLayout();
		westLayout.setHeight(HEIGHT);
		westLayout.setWidth("50%");
		westLayout.addMember(logo);

		// initialise the Signed In User label
		Label signedInUser = new Label();
		signedInUser.setStyleName("head-SignedInUser");
		signedInUser.setContents("<b>Frantisek Lucivjansky</b><br />TUKE");

		// initialise the East layout container
		HLayout eastLayout = new HLayout();
		eastLayout.setAlign(Alignment.RIGHT);
		eastLayout.setHeight(HEIGHT);
		eastLayout.setWidth("50%");
		eastLayout.addMember(signedInUser);

		// add the West and East layout containers to the Masthead layout
		// container
		this.addMember(westLayout);
		this.addMember(eastLayout);
	}
}